﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Text;

namespace SCMS.Model
{
    public static class OrderRequestExtensions
    {
        public static IQueryable<OrderRequestItem> IncludeItem(this IQueryable<OrderRequestItem> queryable)
        {   
            return ((ObjectQuery<OrderRequestItem>) queryable).Include("Item");
        }

        public static IQueryable<OrderRequestItem> IncludeUnitOfMeasure(this IQueryable<OrderRequestItem> queryable)
        {
            return ((ObjectQuery<OrderRequestItem>)queryable).Include("UnitOfMeasure1");
        }

        public static IQueryable<OrderRequestItem> IncludeProjectBudget(this IQueryable<OrderRequestItem> queryable)
        {
            return ((ObjectQuery<OrderRequestItem>)queryable).Include("ProjectBudget");
        }

        public static IQueryable<OrderRequestItem> IncludeProjectDonor(this IQueryable<OrderRequestItem> queryable)
        {
            return ((ObjectQuery<OrderRequestItem>)queryable).Include("ProjectBudget.BudgetCategory.ProjectDonor");
        }

        public static IQueryable<OrderRequestItem> IncludeOrderRequest(this IQueryable<OrderRequestItem> queryable)
        {
            return ((ObjectQuery<OrderRequestItem>)queryable).Include("OrderRequest");
        }
    }
}
